Multi-modality processing with Advanced Normalization Tools (ANTs)

Brian Avants, PICSL and the ANTs Development Team

May X 2015

This presentation is copyrighted by

The ANTs software consortium

distributed under the

Creative Commons by Attribution License 3.0

Background and basics

Simple hints for …

People

History: Theory

History: Implementation

Download ANTs binaries

  • Go to: http://stnava.github.io/ANTs/
  • You will see links for documentation, code, binaries.
  • From the folder ANTS, select a specific release, e.g.: 2.1
  • Select the right version for your platform.

Download ANTsR binaries

  • Go to: http://stnava.github.io/ANTsR/
  • You will see links for documentation, code, binaries.
  • Select the latest release for your platform then:
  • R CMD INSTALL ANTsR*tar.gz

Install ANTs from source: Requires git, cmake, C++

open a terminal window and then type

$>$ git clone http://github.com/stnava/ANTs.git

$>$  mkdir bin

$>$  cd bin/

$>$  ccmake ../ANTS/

Install ANTs from source: Requires git/svn, cmake, C++

then, in cmake, type c and then g then exit back to the terminal. then:

$>$  make -j 4

and wait a while.

ANTs Software Summary

Overview: Program \(+\) brief description

Tool Description
ANTS Interface to a variety of registration algorithms
antsRegistration ITKv4 update to ANTS
Atropos Multivariate probabilitic EM segmentation
N4BiasFieldCorr Novel inhomogeneity field correction method
ImageMath Basic operations on images.
buildtemplateparallel Optimal template construction in the diffeomorphic space.
WarpImageMultiTrans Concatenates ANTS/ITK transforms
antsApplyTransforms Concatenates ANTS/ITK transforms
KellyKapowski Cortical thickness estimation based on volumetric imagery + probabilistic segmentation
sccan Multivariate dimensionality reduction
antsMotionCorr Motion correction + template construction methods for 4D images

Overview: Program \(+\) brief highlights

Tool Highlights
ANTS Best performing normalization algorithm in multiple different studies.
antsRegistration Takes full advantage of multicore processing.
Atropos Can integrate information from multiple modalities and has a DTI-specific likelihood.
N4BiasFieldCorr New standard in bias correction for much of the medical imaging community.
ImageMath Works on 2D, 3D, 4D images.
buildtemplateparallel Used as a standard evaluation target for new template con- struction methodology. New multimodality implementation.
WarpImageMultiTrans Can string together a series of N transforms to minimize interpo- lation error and resample.
antsApplyTransforms Can string together a series of N transforms to minimize interpo- lation error and resample.
KellyKapowski Multi-platform volumetric alternative to Freesurfer
sccan New tools with lots of potential for improving detection power in medical imaging.
antsMotionCorr Simple flexible rigid, affine, deformable motion correction for (mostly) timeseries data.

Overview: Program \(+\) primary reference

Tool PrimaryReference
ANTS A reproducible evaluation of ANTs similarity metric perfor- mance in brain image registration
antsRegistration A unified registration framework for ITK.
Atropos An open source multivariate framework for n-tissue segmentation with evaluation on public data.
N4BiasFieldCorr N4ITK: improved N3 bias correction.
ImageMath —
buildtemplateparallel The optimal template effect in hippocampus studies of diseased population
WarpImageMultiTrans -
antsApplyTransforms -
KellyKapowski Registration based cortical thickness measurement.
sccan Dementia induces correlated reductions in white matter integrity and cortical thickness: a multivariate neuroimaging study with sparse canonical correlation analysis.
antsMotionCorr The pediatric template of brain perfusion

ANTs is good for scripting large-scale studies

App-like framework

  • ANTs likes short bash scripts

  • Longer scripts should use R, ANTsR or perl

  • #! /usr/bin/Rscript

The Basic Toolset

  • Registration: Data is in Examples/Data
ANTS 2 -m  CC[r16slice.nii.gz,r64slice.nii.gz,1,4] 
 -t SyN[0.25]  -r Gauss[3,0] -o TEST -i 50x40x30
  • Segmentation

    Atropos -d 2 -a r16slice.nii.gz -x r16mask.nii.gz 
    -m [0.1,1x1]   -c [10,0]  -i kmeans[3]
    -o [Output.nii.gz,Output\_prob\_\%02d.nii.gz]
  • Template building

     bash buildtemplateparallel.sh -d 3 -m 30x50x20 
    -t GR  -s CC -c 1 -o OutPrefix  *ImageName*T1x.nii.gz

ants-essential tools: a mapping, a segmentation, a template and then label-guided and multivariate versions of these.

Basic applications

  • Quantify changes in cortical thickness in an individual.

  • Perform a template-based study of thickness, gray matter probability, FA, rs connectivity …

  • Identify multivariate relationships between modalities and predictors.

  • Single-subject BOLD fmri study of resting state connectivity.

  • Asymmetry study of neuroanatomy.

  • In general, optimal dimensionality reduction to increase detection power.

Segmenting anatomy from an image

*See examples/segmentation\_example.sh

segmentation_example_input.tex

Multivariate anatomical segmentation

*See examples/segmentation2\_example.sh

segmentation2_example_input.tex

Meaning of segmentation parameters

What happens when i vary each parameter?

-m [0.1,1x1] -m [0.2,1x1]  -m [0.5,1x1]

vs

-i kmeans[ k ]  k = 2 , 3 , 4

Vary MRF param and K in k-means.

Cortical thickness from imaging data

See examples/thickness\_example.sh

thickness_example_input.tex

  • Can vary smoothness, priors on thickness, etc. See help.

ANTs registration

Template-based transformations

How did we compute that transformation?

see cars.sh

Mapping two images

See examples/registration\_example.sh

registration_example_input.tex

Mapping two images

Can vary smoothness, metrics, etc. See help.

Segmenting anatomy from an image Now With Priors!

See examples/segmentation3\_example.sh

via segmentation3_example_input.tex

What is the effect of N4? Should one loop over N4 and Atropos?

Meaning of ANTs registration parameters

What happens when i vary each parameter?

  • Robustness increases with regularization
  • -r Gauss[6,3] $>$ -r Gauss[3,0]

  • Flexibility decreases with regularization
  • -r Gauss[6,3] $<$ -r Gauss[3,0]

  • Robustness increases with correlation window
  • -m CC[ . , . , 1 , 4 ] \(<\) -m CC[ . , . , 1 , 6 ]
  • but computation time also increases

  • Details matter: pre-processing, feature extraction, etc.

  • Successful affine step is essential!!

  • Step-size increases stability but slows convergence
  • SyN[ 0.1 ] more stable than SyN[ 0.25 ].

Check the affine mapping between two images

See examples/registration\_affine\_example.sh

registration_affine_example_input.tex

fixed versus affinely registered image versus original moving

Coordinates of computation time

  • 2D 256\(^2\) pixels intensity difference (MSQ) registration \(\approx\)

  • 3D 256\(^3\) voxels correlation-8 ( CC[ . , . , 1, 8] ) could take if you use full-resolution and the images are very different.

  • or it could take if you use low-resolution and the images are very similar.

Multiple metrics driving registration

face example and why we use LMs @ the same time as data

See examples/registration\_mm\_example.sh

registration_mm_example_input.tex

fixed versus …

Landmark-based registration 1

Landmark-based registration 2

See examples/registration\_lm\_example.sh

registration_lm_example_input.tex

Landmark-based registration 3

fixed versus …

Other Landmark-based registration tools

  • for 3D
  • ANTSUseLandmarkImagesToGetAffineTransform lm1.nii.gz lm2.nii.gz affine outaffine.txt
  • ANTSUseLandmarkImagesToBSplineDisplacementField lm1.nii.gz lm2.nii.gz outLMWarp.nii.gz 10x10x10 6 3 0
  • Then use WarpImageMultiTransform / antsApplyTransform to apply the warp to the relevant image.

Template based studies

Template construction

See examples/btp\_example.sh

btp_example_input.tex

all ``subjects’’

Template construction output

subjects after iteration 1

Template construction output

subjects after iteration 2

Multi-template labeling

btp2_example_input.tex

The template and its groupwise segmentation.

Population statistics

Identifying local predictors of global differences

\[ \text{volume}_{\text{local}} \approx 1 + \text{volume}_{\text{global}} \]

ANTs multivariate voxel-wise statistics

btp3_example_input.tex

The p-value is reported to the screen

…

Now we can compare to standard voxel-wise statistics using R …

…. voxel-wise statistics in R

predictor<-read.csv("/Users/stnava/Documents/writing/ANTS_MultiModality/examples/data/phantpredictors.csv")
predictor<-read.csv("/Users/stnava/Documents/writing/ANTS_MultiModality/examples/templateex/globalvols.csv")
logjac<-read.csv("/Users/stnava/Documents/writing/ANTS_MultiModality/examples/templateex/phantomGlogjacs.csv")
attach( logjac ) ; attach( predictor )
nvox<-ncol(logjac)
pvals<-rep(NA,nvox)
for ( x in c(1:nvox) ) 
{ 
  voxels<-logjac[,x]
  lmres<-summary(lm( voxels ~  vol ))
  coeff<-coefficients( lmres )
  pval<-coeff[2,4]
  pvals[x]<-pval
}
qvals<-p.adjust(pvals)
print(min(qvals))
## [1] 0.008211303

Comparison of results

SCCAN p-value \(\approx 0.003\) minimum FDR-corrected p-value \(\approx 0.009\) but results are similar. FDR threshold \(=0.05\).

Multiple modality processing

Templates for all modalities

Templates for the same population T1, FA and BOLD.

We exploit population templates to extract the brain and set-up modality specific brain extraction and segmentation.

Longitudinal analysis with ANTs

Look at your data to verify the quality of the rigid mapping!

Processing of diffusion tensor data.

  • Intra-subject matching ( T1 \(\rightarrow\) FA )
  • Compose warps for template space warp
  • Warp and reorient with preservation of principal direction
  • Get derived images (FA, MD, RGB, etc)

Processing of diffusion tensor data.

Subject FA & Subject T1 & Aligned composite

Time series / rsfMRI analysis with ANTs

See examples/motioncorr\_example.sh motioncorr_example_input.tex

  • mi — mutual information metric

  • Rigid — use rigid map to the average with gradient step 0.05

  • other params — smoothing, scale estimation, iterations …

Time series / rsfMRI analysis with ANTs

Time series / rsfMRI analysis with ANTs

Time series / rsfMRI analysis with ANTs}

Extracting a resting state network

See examples/rsfnodes\_example.sh

rsfnodes_example_input.tex

Then build a graph ( see iGraph ).

How does structure and functional connectivity elaborate during development?

open data

Reproducibility

  • ANTs is ideal for producing reproducible research.

  • It is multi-platform and portable.

  • It can easily be modified for \(+++\) different types of studies.

Reproducibility

  • ANTs allows one to access the powers of both ITK and R.

  • We aim to support user needs so if you can’t find something, just ask …. Questions?

Acknowledgements

  • NIBIB for software development support under grant R01-EB006266-01.
  • The ITK development team.
  • Dr. Murray Grossman for pushing application development.
  • The NLM for providing stimulus funding in support of ITKv4.